package com.code.day02.Druids;

import com.code.day02.utils.C3p0;
import com.code.day02.utils.DruidUtils;
import org.junit.Test;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class DemoDruid {
    @Test
    public void insert() throws Exception {
        Connection conn = DruidUtils.getConnection();
        PreparedStatement pst = conn.prepareStatement("insert into user(username, password) values(?,?)");
        pst.setString(1, "ADAS");
        pst.setString(2, "213");
        pst.execute();

        C3p0.close(conn,pst,null);
    }
}
